(defun common (l m)
  (cond
	((or (null l) (null m)) 0)
	((= (first l) (first m)) (1+ (common (rest l) (rest m))))
	((< (first l) (first m)) (common (rest l) m))
	(T (common l (rest m)))))

(let ((l nil) (m '(3 4)))
  (print l)
  (print m)
  (print (common l m))
  (print ""))
(let ((l '(1 2)) (m nil))
  (print l)
  (print m)
  (print (common l m))
  (print ""))
(let ((l '(1 2)) (m '(3 4)))
  (print l)
  (print m)
  (print (common l m))
  (print ""))
(let ((l '(1 2 3)) (m '(3 4)))
  (print l)
  (print m)
  (print (common l m))
  (print ""))
